package cn.zy.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.zy.bean.User;
import cn.zy.dao.UserDao;
import cn.zy.service.UserService;

@Service("userServiceI")
public class UserServiceI implements UserService {

	@Resource(name = "userDaoBean")
	private UserDao userdaobean;
	
	

	@Override
	public boolean save(User user) {
		if (userdaobean.findUser(user.getNickname()) == null) {
			user.setRegisterdate(new Date());
			userdaobean.saveUser(user);
			return true;

		} else {
			return false;
		}

	}

	@Override
	public void update(User regiateruser) {
		// TODO Auto-generated method stub

	}

	/* @Transactional(propagation = Propagation.NOT_SUPPORTED) */
	public User find(String username) {

		return null;
	}

	@Override
	public void delete(String... Usernames) {
		// TODO Auto-generated method stub

	}

	@Override
	public List<User> list() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public User findSUser(String telephone, String password) {
		User user=new User();
		user=userdaobean.findDUser(telephone, password);
		return user;
	}

}
